{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<!-- 订单搜索 -->
<div class="form-div">
    <form action="javascript:searchOrder()" name="searchForm">
        <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
        {$lang.old_order_sn}<input name="old_order_sn" type="text" id="old_order_sn" size="15">
        {$lang.consignee|escape}<input name="consignee" type="text" id="consignee" size="15">
        {$lang.status}
        <select name="status" id="status">
            <option value="-1">{$lang.select_please}</option>
            <option value="5">{$lang.finished}</option>
            <option value="1">{$lang.unfinished}</option>
        </select>
        <input type="submit" value="{$lang.button_search}" class="button" />
    </form>
</div>

<!-- 订单列表 -->
<form method="post" action="order.php?act=bach_remove_back" name="listForm" onsubmit="return check()">
    <div class="list-div" id="listDiv">
        {/if}

        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>
                    <input onclick='listTable.selectAll(this, "back_id")' type="checkbox"/>{$lang.order_id}</th>
                <th><a href="javascript:listTable.sort('order_sn', 'DESC'); ">{$lang.old_order_sn}</a>{$sort_order_sn}</th>
                <th>{$lang.back_goods}</th>
                <th><a href="javascript:listTable.sort('add_time', 'DESC'); ">{$lang.apply_time}</a>{$sort_apply_time}</th>
                <th>{$lang.refund_money}</th>
                <th>{$lang.real_money}</th>
                <th><a href="javascript:listTable.sort('consignee', 'DESC'); ">{$lang.consignee}</a>{$sort_consignee}</th>
                <th>{$lang.status}</th>
                <th>{$lang.applicant}</th>
                <th>{$lang.handler}</th>
            <tr>
                {foreach from=$back_list item=back key=dkey}
            <tr>
                <td><input type="checkbox" name="back_id[]" value="{$back.back_id}" />{$back.back_id}</td>
                <td align="center">{$back.order_sn}</td>
                <td align="left">ID:{$back.goods_id}<br/>{$back.goods_name}</td>
                <td align="center">{$back.update_time}</td>
                <td align="center">{$back.goods_price}</td>
                <td align="center">{$back.back_money}</td>
                <td align="left">{$back.consignee|escape} <!--{if $back.mobile}-->({$lang.label_mobile}{$back.mobile})<!--{/if}--> <br/>{$back.address}</td>
                <td align="center">{$back.status_name}</td>
                <td align="center">{$back.consignee}</td>
                <td align="center"><a href="order.php?act=back_info&back_id={$back.back_id}">{$lang.detail}</a><!--{if $back.status eq 1}--> | <a onclick="{if(confirm('{$lang.confirm_delete}')){return true;}return false;}" href="order.php?act=remove_back_order&back_id={$back.back_id}">{$lang.remove}</a><!--{/if}-->
                </td>
            </tr>
            {/foreach}
        </table>

        <!-- 分页 -->
        <table id="page-table" cellspacing="0">
            <tr>
                <td align="right" nowrap="true">
                    {include file="page.htm"}
                </td>
            </tr>
        </table>

        {if $full_page}
    </div>
    <div>
        <input name="remove_back" type="submit" id="btnSubmit3" value="{$lang.remove}" class="button" disabled="true" onclick="{if(confirm('{$lang.confirm_delete}')){return true;}return false;}" />
    </div>
</form>
<script language="JavaScript">
    listTable.recordCount = {$record_count};
    listTable.pageCount = {$page_count};

    {foreach from=$filter item=item key=key}
    listTable.filter.{$key} = '{$item}';
    {/foreach}
    {literal}

    onload = function()
    {
        // 开始检查订单
        startCheckOrder();

        //
        listTable.query = "back_query";
    }

    /**
     * 搜索退换货列表
     */
    function searchOrder()
    {
        listTable.filter['old_order_sn'] = Utils.trim(document.forms['searchForm'].elements['old_order_sn'].value);
        listTable.filter['consignee'] = Utils.trim(document.forms['searchForm'].elements['consignee'].value);
        listTable.filter['status'] = document.forms['searchForm'].elements['status'].value;
        listTable.filter['page'] = 1;
        listTable.query = "back_query";
        listTable.loadList();
    }

    function check()
    {
        var snArray = new Array();
        var eles = document.forms['listForm'].elements;
        for (var i=0; i<eles.length; i++)
        {
            if (eles[i].tagName == 'INPUT' && eles[i].type == 'checkbox' && eles[i].checked && eles[i].value != 'on')
            {
                snArray.push(eles[i].value);
            }
        }
        if (snArray.length == 0)
        {
            return false;
        }
        else
        {
            eles['back_id'].value = snArray.toString();
            return true;
        }
    }
</script>
{/literal}

{include file="pagefooter.htm"}
{/if}